<?php

class SunsystemOverview implements View
{
    /**
     * @var Sunsystem
     */
    protected $System;
    
    public function __construct($sytemID)
    {
        $this->System = MapperRegistry::get(Sunsystem::MAPPER_ID)->getByID($systemID)->get();
        if (!($this->System instanceof Sunsystem)) {
            throw new SunsystemException(get_class($this).': could not get the sunsystem with ID:'.$systemID);
        }
    }
    
    public function result()
    {
        return array(
            'header' => '{L_sunsystem}:'.$this->System->getName(),
            'row' => array(
                array('col1' => '{L_size}', 'col2' => $this->System->getSize()), 
                array('col1' => '{L_position}', 'col2' => $this->System->getPosition())
            )
        );
    }
    
    public function templateFile()
    {
        return 'overview';
    }
}